package com.service.dba;

import com.dao.dba.DbaDaoImpl;
import com.enitiy.Dba;

import java.sql.SQLException;

/**
 * 创建作者 ：MySunshine
 * 创建时间 2022/10/24 15:26
 * 项目名称 SHUSHAN
 */
public class DbaServiceImpl  implements  DbaService{
    DbaDaoImpl ddi = new DbaDaoImpl();
    @Override //管理员登录
    public Dba DbaLogin(int num, String pwd) {
        Dba dba = null;
        try {
            dba = ddi.DbaLogin(num, pwd);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return dba;
    }

    @Override   //根据账号查询
    public Dba DbaSelectByNum(int num) {
        Dba dba = null;
        try {
            dba = ddi.DbaSelectByNum(num);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return dba;
    }

    @Override//根据账号修改
    public boolean DbaUpdateByNum(Dba dba) {
        boolean b = false;
        try {
            b = ddi.DbaUpdateByNum(dba);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return b;
    }
}
